use axum::{
    extract::{State, Query},
    http::{Response, StatusCode},
    Json,
};
use tracing::{info, error};

use crate::{
    models::news_search::*,
    services::NewsSearchService,
};

pub async fn search_news_by_keywords(
    State(news_search_service): State<NewsSearchService>,
    Query(params): Query<SearchParams>
) -> Json<Vec<NewsMeta>> {
    news_search_service.search_news_by_keywords(Query(params)).await
}

